﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.Xpo;

namespace POI.eTransmittal.Enitity
{
    [OptimisticLocking(false), DeferredDeletion(false)]
   public  class Inbox:XPCustomObject
    {
        public Inbox()
        {
        }
        public Inbox(Session session):base(session)
        {

        }
        [Key]
        public string Name;
        public string EmailAddress;
        public bool IsDefault;
        [Size(100)]
        public string Description;

        #region AuditTrail

        public DateTime CreatedDate;

        public string CreatedBy;

        public DateTime LastChangedDate;

        public string LastChangedBy;

        public void Save(string userId)
        {
            if (CreatedBy == null || CreatedDate == DateTime.MinValue)
            {
                this.CreatedDate = DateTime.Now;
                this.CreatedBy = userId;
            }

            this.LastChangedDate = DateTime.Now;
            this.LastChangedBy = userId;

            this.Save();
        }

        #endregion
    }
}
